<template>
	<view class="page">
		
		<u--text :text="detail.name" align="center" :bold="true" size="22" lineHeight="42"></u--text>
		
		<view style="display: flex;margin-bottom: 20rpx;">
			<u--text type="info" :text="'发布者:' + detail.author"></u--text>
			<u--text align="right" type="info" :text="'发布时间:' + detail.date.substring(0,10)" lineHeight="22"></u--text>
		</view>
		
		<view>
			<u-parse :content="detail.content"></u-parse>
		</view>
	</view>
</template>

<script>
	import * as NewsApi from '@/api/news.js';
	export default {
		data() {
			return {
				nid: 0,
				detail: {}
			}
		},
		onLoad(e) {
			this.nid = e.id
			this.getDetail()
		},
		/*分享当前页面*/
		onShareAppMessage() {},
		onShareTimeline() {},
		methods: {
			getDetail() {
				let that = this;
				NewsApi.detail({
					nid: this.nid
				}).then(res => {
					this.detail = res.info
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	.page {
		padding: 40rpx 20rpx;
	}
</style>